package com.yb.guigu.pick.upload.util;

import com.yb.guigu.pick.minio.upload.bean.MinioProperties;
import com.yb.guigu.pick.upload.bean.UploadRequest;
import com.yb.guigu.pick.upload.bean.UploadResponse;
import com.yb.guigu.pick.upload.client.UploadClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Copyright (C), 2022-2023, 姚兵
 * Author: 32210
 * Date: 2023/6/2 15:14
 * FileName: UploadUtil
 * Description:
 */
@Component
@Slf4j
public class UploadUtil {

    @Autowired
    UploadClient uploadClient;


    @Autowired
    MinioProperties minioProperties;

    public boolean uploadImage(UploadRequest uploadRequest){


        UploadResponse upload = uploadClient.upload(uploadRequest);

        return upload.isSuccess();

    }

}
